<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Images</title>
<meta name="generator" content="DocBook XSL Stylesheets V1.74.0">
<link rel="home" href="index.html" title="GDK Reference Manual">
<link rel="up" href="reference.html" title="API Reference">
<link rel="prev" href="gdk-GdkRGB.html" title="GdkRGB">
<link rel="next" href="gdk-Pixbufs.html" title="Pixbufs">
<meta name="generator" content="GTK-Doc V1.11 (XML mode)">
<link rel="stylesheet" href="style.css" type="text/css">
<link rel="reference" href="reference.html" title="API Reference">
<link rel="index" href="api-index-full.html" title="Index of all symbols">
<link rel="index" href="api-index-deprecated.html" title="Index of deprecated symbols">
<link rel="index" href="api-index-2-2.html" title="Index of new symbols in 2.2">
<link rel="index" href="api-index-2-4.html" title="Index of new symbols in 2.4">
<link rel="index" href="api-index-2-6.html" title="Index of new symbols in 2.6">
<link rel="index" href="api-index-2-8.html" title="Index of new symbols in 2.8">
<link rel="index" href="api-index-2-10.html" title="Index of new symbols in 2.10">
<link rel="index" href="api-index-2-12.html" title="Index of new symbols in 2.12">
<link rel="index" href="api-index-2-14.html" title="Index of new symbols in 2.14">
</head>
<body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF">
<table class="navigation" id="top" width="100%" summary="Navigation header" cellpadding="2" cellspacing="2">
<tr valign="middle">
<td><a accesskey="p" href="gdk-GdkRGB.html"><img src="left.png" width="24" height="24" border="0" alt="Prev"></a></td>
<td><a accesskey="u" href="reference.html"><img src="up.png" width="24" height="24" border="0" alt="Up"></a></td>
<td><a accesskey="h" href="index.html"><img src="home.png" width="24" height="24" border="0" alt="Home"></a></td>
<th width="100%" align="center">GDK Reference Manual</th>
<td><a accesskey="n" href="gdk-Pixbufs.html"><img src="right.png" width="24" height="24" border="0" alt="Next"></a></td>
</tr>
<tr><td colspan="5" class="shortcuts">
<a href="#gdk-Images.synopsis" class="shortcut">Top</a>
                 | 
                <a href="#gdk-Images.description" class="shortcut">Description</a>
</td></tr>
</table>
<div class="refentry" lang="en">
<a name="gdk-Images"></a><div class="titlepage"></div>
<div class="refnamediv"><table width="100%"><tr>
<td valign="top">
<h2><span class="refentrytitle"><a name="gdk-Images.top_of_page"></a>Images</span></h2>
<p>Images — A client-side area for bit-mapped graphics</p>
</td>
<td valign="top" align="right"></td>
</tr></table></div>
<div class="refsynopsisdiv">
<a name="gdk-Images.synopsis"></a><h2>Synopsis</h2>
<pre class="synopsis">

#include &lt;gdk/gdk.h&gt;

                    <a class="link" href="gdk-Images.html#GdkImage" title="GdkImage">GdkImage</a>;
<a class="link" href="gdk-Images.html#GdkImage" title="GdkImage">GdkImage</a>*           <a class="link" href="gdk-Images.html#gdk-image-new" title="gdk_image_new ()">gdk_image_new</a>                       (<a class="link" href="gdk-Images.html#GdkImageType" title="enum GdkImageType">GdkImageType</a> type,
                                                         <a class="link" href="gdk-Visuals.html#GdkVisual" title="GdkVisual">GdkVisual</a> *visual,
                                                         <a
href="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#gint"
>gint</a> width,
                                                         <a
href="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#gint"
>gint</a> height);
enum                <a class="link" href="gdk-Images.html#GdkImageType" title="enum GdkImageType">GdkImageType</a>;
<a class="link" href="gdk-Images.html#GdkImage" title="GdkImage">GdkImage</a>*           <a class="link" href="gdk-Images.html#gdk-image-new-bitmap" title="gdk_image_new_bitmap ()">gdk_image_new_bitmap</a>                (<a class="link" href="gdk-Visuals.html#GdkVisual" title="GdkVisual">GdkVisual</a> *visual,
                                                         <a
href="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#gpointer"
>gpointer</a> data,
                                                         <a
href="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#gint"
>gint</a> width,
                                                         <a
href="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#gint"
>gint</a> height);
<a class="link" href="gdk-Images.html#GdkImage" title="GdkImage">GdkImage</a>*           <a class="link" href="gdk-Images.html#gdk-image-get" title="gdk_image_get ()">gdk_image_get</a>                       (<a class="link" href="gdk-Drawing-Primitives.html#GdkDrawable">GdkDrawable</a> *drawable,
                                                         <a
href="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#gint"
>gint</a> x,
                                                         <a
href="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#gint"
>gint</a> y,
                                                         <a
href="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#gint"
>gint</a> width,
                                                         <a
href="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#gint"
>gint</a> height);
<a class="link" href="gdk-Images.html#GdkImage" title="GdkImage">GdkImage</a> *          <a class="link" href="gdk-Images.html#gdk-image-ref" title="gdk_image_ref ()">gdk_image_ref</a>                       (<a class="link" href="gdk-Images.html#GdkImage" title="GdkImage">GdkImage</a> *image);
void                <a class="link" href="gdk-Images.html#gdk-image-unref" title="gdk_image_unref ()">gdk_image_unref</a>                     (<a class="link" href="gdk-Images.html#GdkImage" title="GdkImage">GdkImage</a> *image);
#define             <a class="link" href="gdk-Images.html#gdk-image-destroy" title="gdk_image_destroy">gdk_image_destroy</a>
<a class="link" href="gdk-Colormaps-and-Colors.html#GdkColormap" title="GdkColormap">GdkColormap</a>*        <a class="link" href="gdk-Images.html#gdk-image-get-colormap" title="gdk_image_get_colormap ()">gdk_image_get_colormap</a>              (<a class="link" href="gdk-Images.html#GdkImage" title="GdkImage">GdkImage</a> *image);
void                <a class="link" href="gdk-Images.html#gdk-image-set-colormap" title="gdk_image_set_colormap ()">gdk_image_set_colormap</a>              (<a class="link" href="gdk-Images.html#GdkImage" title="GdkImage">GdkImage</a> *image,
                                                         <a class="link" href="gdk-Colormaps-and-Colors.html#GdkColormap" title="GdkColormap">GdkColormap</a> *colormap);

void                <a class="link" href="gdk-Images.html#gdk-image-put-pixel" title="gdk_image_put_pixel ()">gdk_image_put_pixel</a>                 (<a class="link" href="gdk-Images.html#GdkImage" title="GdkImage">GdkImage</a> *image,
                                                         <a
href="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#gint"
>gint</a> x,
                                                         <a
href="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#gint"
>gint</a> y,
                                                         <a
href="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#guint32"
>guint32</a> pixel);
<a
href="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#guint32"
>guint32</a>             <a class="link" href="gdk-Images.html#gdk-image-get-pixel" title="gdk_image_get_pixel ()">gdk_image_get_pixel</a>                 (<a class="link" href="gdk-Images.html#GdkImage" title="GdkImage">GdkImage</a> *image,
                                                         <a
href="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#gint"
>gint</a> x,
                                                         <a
href="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#gint"
>gint</a> y);
</pre>
</div>
<div class="refsect1" lang="en">
<a name="gdk-Images.description"></a><h2>Description</h2>
<p>
The <a class="link" href="gdk-Images.html#GdkImage" title="GdkImage"><span class="type">GdkImage</span></a> type represents an area for drawing graphics.
It has now been superceded to a large extent by the much more flexible
<a class="link" href="gdk-GdkRGB.html" title="GdkRGB">GdkRGB</a> functions.
</p>
<p>
To create an empty <a class="link" href="gdk-Images.html#GdkImage" title="GdkImage"><span class="type">GdkImage</span></a> use <a class="link" href="gdk-Images.html#gdk-image-new" title="gdk_image_new ()"><code class="function">gdk_image_new()</code></a>.
To create a <a class="link" href="gdk-Images.html#GdkImage" title="GdkImage"><span class="type">GdkImage</span></a> from bitmap data use <a class="link" href="gdk-Images.html#gdk-image-new-bitmap" title="gdk_image_new_bitmap ()"><code class="function">gdk_image_new_bitmap()</code></a>.
To create an image from part of a <a class="link" href="gdk-Windows.html#GdkWindow"><span class="type">GdkWindow</span></a> use <a class="link" href="gdk-Drawing-Primitives.html#gdk-drawable-get-image" title="gdk_drawable_get_image ()"><code class="function">gdk_drawable_get_image()</code></a>.
</p>
<p>
The image can be manipulated with <a class="link" href="gdk-Images.html#gdk-image-get-pixel" title="gdk_image_get_pixel ()"><code class="function">gdk_image_get_pixel()</code></a> and
<a class="link" href="gdk-Images.html#gdk-image-put-pixel" title="gdk_image_put_pixel ()"><code class="function">gdk_image_put_pixel()</code></a>, or alternatively by changing the actual pixel data.
Though manipulating the pixel data requires complicated code to cope with
the different formats that may be used.
</p>
<p>
To draw a <a class="link" href="gdk-Images.html#GdkImage" title="GdkImage"><span class="type">GdkImage</span></a> in a <a class="link" href="gdk-Windows.html#GdkWindow"><span class="type">GdkWindow</span></a> or <a class="link" href="gdk-Bitmaps-and-Pixmaps.html#GdkPixmap"><span class="type">GdkPixmap</span></a> use <a class="link" href="gdk-Drawing-Primitives.html#gdk-draw-image" title="gdk_draw_image ()"><code class="function">gdk_draw_image()</code></a>.
</p>
<p>
To destroy a <a class="link" href="gdk-Images.html#GdkImage" title="GdkImage"><span class="type">GdkImage</span></a> use <a class="link" href="gdk-Images.html#gdk-image-destroy" title="gdk_image_destroy"><code class="function">gdk_image_destroy()</code></a>.
</p>
</div>
<div class="refsect1" lang="en">
<a name="gdk-Images.details"></a><h2>Details</h2>
<div class="refsect2" lang="en">
<a name="GdkImage"></a><h3>GdkImage</h3>
<pre class="programlisting">typedef struct {
  GObject parent_instance;

  
  GdkImageType	type; /* read only. */
  GdkVisual    *visual;	    /* read only. visual used to create the image */
  GdkByteOrder	byte_order; /* read only. */
  gint		width; /* read only. */
  gint		height; /* read only. */
  guint16	depth; /* read only. */
  guint16	bpp;	        /* read only. bytes per pixel */
  guint16	bpl;	        /* read only. bytes per line */
  guint16       bits_per_pixel; /* read only. bits per pixel */
  gpointer	mem;

  GdkColormap  *colormap; /* read only. */
} GdkImage;
</pre>
<p>
The <a class="link" href="gdk-Images.html#GdkImage" title="GdkImage"><span class="type">GdkImage</span></a> struct contains information on the image and the pixel data.
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td><p><span class="term"><a
href="/usr/share/gtk-doc/html/gobject/gobject-The-Base-Object-Type.html#GObject"
>GObject</a> <em class="structfield"><code>parent_instance</code></em>;</span></p></td>
<td>the parent instance
</td>
</tr>
<tr>
<td><p><span class="term"><a class="link" href="gdk-Images.html#GdkImageType" title="enum GdkImageType">GdkImageType</a> <em class="structfield"><code>type</code></em>;</span></p></td>
<td>the type of the image.
</td>
</tr>
<tr>
<td><p><span class="term"><a class="link" href="gdk-Visuals.html#GdkVisual" title="GdkVisual">GdkVisual</a> *<em class="structfield"><code>visual</code></em>;</span></p></td>
<td>the visual.
</td>
</tr>
<tr>
<td><p><span class="term"><a class="link" href="gdk-Visuals.html#GdkByteOrder" title="enum GdkByteOrder">GdkByteOrder</a> <em class="structfield"><code>byte_order</code></em>;</span></p></td>
<td>the byte order.
</td>
</tr>
<tr>
<td><p><span class="term"><a
href="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#gint"
>gint</a> <em class="structfield"><code>width</code></em>;</span></p></td>
<td>the width of the image in pixels.
</td>
</tr>
<tr>
<td><p><span class="term"><a
href="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#gint"
>gint</a> <em class="structfield"><code>height</code></em>;</span></p></td>
<td>the height of the image in pixels.
</td>
</tr>
<tr>
<td><p><span class="term"><a
href="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#guint16"
>guint16</a> <em class="structfield"><code>depth</code></em>;</span></p></td>
<td>the depth of the image, i.e. the number of bits per pixel.
</td>
</tr>
<tr>
<td><p><span class="term"><a
href="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#guint16"
>guint16</a> <em class="structfield"><code>bpp</code></em>;</span></p></td>
<td>the number of bytes per pixel.
</td>
</tr>
<tr>
<td><p><span class="term"><a
href="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#guint16"
>guint16</a> <em class="structfield"><code>bpl</code></em>;</span></p></td>
<td>the number of bytes per line of the image.
</td>
</tr>
<tr>
<td><p><span class="term"><a
href="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#guint16"
>guint16</a> <em class="structfield"><code>bits_per_pixel</code></em>;</span></p></td>
<td>the number of bits per pixel.
</td>
</tr>
<tr>
<td><p><span class="term"><a
href="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#gpointer"
>gpointer</a> <em class="structfield"><code>mem</code></em>;</span></p></td>
<td>the pixel data.
</td>
</tr>
<tr>
<td><p><span class="term"><a class="link" href="gdk-Colormaps-and-Colors.html#GdkColormap" title="GdkColormap">GdkColormap</a> *<em class="structfield"><code>colormap</code></em>;</span></p></td>
<td>the <a class="link" href="gdk-Colormaps-and-Colors.html#GdkColormap" title="GdkColormap"><span class="type">GdkColormap</span></a> associated with the image
</td>
</tr>
</tbody>
</table></div>
</div>
<hr>
<div class="refsect2" lang="en">
<a name="gdk-image-new"></a><h3>gdk_image_new ()</h3>
<pre class="programlisting"><a class="link" href="gdk-Images.html#GdkImage" title="GdkImage">GdkImage</a>*           gdk_image_new                       (<a class="link" href="gdk-Images.html#GdkImageType" title="enum GdkImageType">GdkImageType</a> type,
                                                         <a class="link" href="gdk-Visuals.html#GdkVisual" title="GdkVisual">GdkVisual</a> *visual,
                                                         <a
href="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#gint"
>gint</a> width,
                                                         <a
href="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#gint"
>gint</a> height);</pre>
<p>
Creates a new <a class="link" href="gdk-Images.html#GdkImage" title="GdkImage"><span class="type">GdkImage</span></a>.
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td><p><span class="term"><em class="parameter"><code>type</code></em> :</span></p></td>
<td>the type of the <a class="link" href="gdk-Images.html#GdkImage" title="GdkImage"><span class="type">GdkImage</span></a>, one of <a class="link" href="gdk-Images.html#GDK-IMAGE-NORMAL--CAPS"><code class="literal">GDK_IMAGE_NORMAL</code></a>, <a class="link" href="gdk-Images.html#GDK-IMAGE-SHARED--CAPS"><code class="literal">GDK_IMAGE_SHARED</code></a>
and <a class="link" href="gdk-Images.html#GDK-IMAGE-FASTEST--CAPS"><code class="literal">GDK_IMAGE_FASTEST</code></a>. <a class="link" href="gdk-Images.html#GDK-IMAGE-FASTEST--CAPS"><code class="literal">GDK_IMAGE_FASTEST</code></a> is probably the best choice, since
it will try creating a <a class="link" href="gdk-Images.html#GDK-IMAGE-SHARED--CAPS"><code class="literal">GDK_IMAGE_SHARED</code></a> image first and if that fails it will
then use <a class="link" href="gdk-Images.html#GDK-IMAGE-NORMAL--CAPS"><code class="literal">GDK_IMAGE_NORMAL</code></a>.
</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>visual</code></em> :</span></p></td>
<td>the <a class="link" href="gdk-Visuals.html#GdkVisual" title="GdkVisual"><span class="type">GdkVisual</span></a> to use for the image.
</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>width</code></em> :</span></p></td>
<td>the width of the image in pixels.
</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>height</code></em> :</span></p></td>
<td>the height of the image in pixels.
</td>
</tr>
<tr>
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
<td>a new <a class="link" href="gdk-Images.html#GdkImage" title="GdkImage"><span class="type">GdkImage</span></a>, or <a
href="/usr/share/gtk-doc/html/glib/glib-Standard-Macros.html#NULL--CAPS"
><code class="literal">NULL</code></a> if the image could not be created.
</td>
</tr>
</tbody>
</table></div>
</div>
<hr>
<div class="refsect2" lang="en">
<a name="GdkImageType"></a><h3>enum GdkImageType</h3>
<pre class="programlisting">typedef enum
{
  GDK_IMAGE_NORMAL,
  GDK_IMAGE_SHARED,
  GDK_IMAGE_FASTEST
} GdkImageType;
</pre>
<p>
Specifies the type of a <a class="link" href="gdk-Images.html#GdkImage" title="GdkImage"><span class="type">GdkImage</span></a>.
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td><p><a name="GDK-IMAGE-NORMAL--CAPS"></a><span class="term"><code class="literal">GDK_IMAGE_NORMAL</code></span></p></td>
<td>The original X image type, which is quite slow since the
image has to be transferred from the client to the server to display it.
</td>
</tr>
<tr>
<td><p><a name="GDK-IMAGE-SHARED--CAPS"></a><span class="term"><code class="literal">GDK_IMAGE_SHARED</code></span></p></td>
<td>A faster image type, which uses shared memory to transfer
the image data between client and server. However this will only be available
if client and server are on the same machine and the shared memory extension
is supported by the server.
</td>
</tr>
<tr>
<td><p><a name="GDK-IMAGE-FASTEST--CAPS"></a><span class="term"><code class="literal">GDK_IMAGE_FASTEST</code></span></p></td>
<td>Specifies that <a class="link" href="gdk-Images.html#GDK-IMAGE-SHARED--CAPS"><code class="literal">GDK_IMAGE_SHARED</code></a> should be tried first,
and if that fails then <a class="link" href="gdk-Images.html#GDK-IMAGE-NORMAL--CAPS"><code class="literal">GDK_IMAGE_NORMAL</code></a> will be used.
</td>
</tr>
</tbody>
</table></div>
</div>
<hr>
<div class="refsect2" lang="en">
<a name="gdk-image-new-bitmap"></a><h3>gdk_image_new_bitmap ()</h3>
<pre class="programlisting"><a class="link" href="gdk-Images.html#GdkImage" title="GdkImage">GdkImage</a>*           gdk_image_new_bitmap                (<a class="link" href="gdk-Visuals.html#GdkVisual" title="GdkVisual">GdkVisual</a> *visual,
                                                         <a
href="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#gpointer"
>gpointer</a> data,
                                                         <a
href="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#gint"
>gint</a> width,
                                                         <a
href="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#gint"
>gint</a> height);</pre>
<div class="warning" style="margin-left: 0.5in; margin-right: 0.5in;">
<h3 class="title">Warning</h3>
<p><code class="literal">gdk_image_new_bitmap</code> is deprecated and should not be used in newly-written code.</p>
</div>
<p>
Creates a new <a class="link" href="gdk-Images.html#GdkImage" title="GdkImage"><span class="type">GdkImage</span></a> with a depth of 1 from the given data.
</p>
<div class="warning" style="margin-left: 0.5in; margin-right: 0.5in;">
<h3 class="title">Warning</h3>
<p>THIS FUNCTION IS INCREDIBLY BROKEN. The passed-in data must 
be allocated by <code class="function">malloc()</code> (NOT <a
href="/usr/share/gtk-doc/html/glib/glib-Memory-Allocation.html#g-malloc"
><code class="function">g_malloc()</code></a>) and will be freed when the 
image is freed.</p>
</div>
<p>
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td><p><span class="term"><em class="parameter"><code>visual</code></em> :</span></p></td>
<td> the <a class="link" href="gdk-Visuals.html#GdkVisual" title="GdkVisual"><span class="type">GdkVisual</span></a> to use for the image.
</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>data</code></em> :</span></p></td>
<td> the pixel data. 
</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>width</code></em> :</span></p></td>
<td> the width of the image in pixels. 
</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>height</code></em> :</span></p></td>
<td> the height of the image in pixels. 
</td>
</tr>
<tr>
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
<td> a new <a class="link" href="gdk-Images.html#GdkImage" title="GdkImage"><span class="type">GdkImage</span></a>.
</td>
</tr>
</tbody>
</table></div>
</div>
<hr>
<div class="refsect2" lang="en">
<a name="gdk-image-get"></a><h3>gdk_image_get ()</h3>
<pre class="programlisting"><a class="link" href="gdk-Images.html#GdkImage" title="GdkImage">GdkImage</a>*           gdk_image_get                       (<a class="link" href="gdk-Drawing-Primitives.html#GdkDrawable">GdkDrawable</a> *drawable,
                                                         <a
href="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#gint"
>gint</a> x,
                                                         <a
href="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#gint"
>gint</a> y,
                                                         <a
href="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#gint"
>gint</a> width,
                                                         <a
href="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#gint"
>gint</a> height);</pre>
<div class="warning" style="margin-left: 0.5in; margin-right: 0.5in;">
<h3 class="title">Warning</h3>
<p><code class="literal">gdk_image_get</code> is deprecated and should not be used in newly-written code.</p>
</div>
<p>
This is a deprecated wrapper for <a class="link" href="gdk-Drawing-Primitives.html#gdk-drawable-get-image" title="gdk_drawable_get_image ()"><code class="function">gdk_drawable_get_image()</code></a>;
<a class="link" href="gdk-Drawing-Primitives.html#gdk-drawable-get-image" title="gdk_drawable_get_image ()"><code class="function">gdk_drawable_get_image()</code></a> should be used instead. Or even better: in
most cases <a class="link" href="gdk-Pixbufs.html#gdk-pixbuf-get-from-drawable" title="gdk_pixbuf_get_from_drawable ()"><code class="function">gdk_pixbuf_get_from_drawable()</code></a> is the most convenient
choice.</p>
<p>
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td><p><span class="term"><em class="parameter"><code>drawable</code></em> :</span></p></td>
<td> a <a class="link" href="gdk-Drawing-Primitives.html#GdkDrawable"><span class="type">GdkDrawable</span></a>
</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>x</code></em> :</span></p></td>
<td> x coordinate in <em class="parameter"><code>window</code></em>
</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>y</code></em> :</span></p></td>
<td> y coordinate in <em class="parameter"><code>window</code></em>
</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>width</code></em> :</span></p></td>
<td> width of area in <em class="parameter"><code>window</code></em>
</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>height</code></em> :</span></p></td>
<td> height of area in <em class="parameter"><code>window</code></em>
</td>
</tr>
<tr>
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
<td> a new <a class="link" href="gdk-Images.html#GdkImage" title="GdkImage"><span class="type">GdkImage</span></a> or <a
href="/usr/share/gtk-doc/html/glib/glib-Standard-Macros.html#NULL--CAPS"
><code class="literal">NULL</code></a>
</td>
</tr>
</tbody>
</table></div>
</div>
<hr>
<div class="refsect2" lang="en">
<a name="gdk-image-ref"></a><h3>gdk_image_ref ()</h3>
<pre class="programlisting"><a class="link" href="gdk-Images.html#GdkImage" title="GdkImage">GdkImage</a> *          gdk_image_ref                       (<a class="link" href="gdk-Images.html#GdkImage" title="GdkImage">GdkImage</a> *image);</pre>
<div class="warning" style="margin-left: 0.5in; margin-right: 0.5in;">
<h3 class="title">Warning</h3>
<p><code class="literal">gdk_image_ref</code> is deprecated and should not be used in newly-written code.</p>
</div>
<p>
Deprecated function; use <a
href="/usr/share/gtk-doc/html/gobject/gobject-The-Base-Object-Type.html#g-object-ref"
><code class="function">g_object_ref()</code></a> instead.</p>
<p>
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td><p><span class="term"><em class="parameter"><code>image</code></em> :</span></p></td>
<td> a <a class="link" href="gdk-Images.html#GdkImage" title="GdkImage"><span class="type">GdkImage</span></a>
</td>
</tr>
<tr>
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
<td> the image
</td>
</tr>
</tbody>
</table></div>
</div>
<hr>
<div class="refsect2" lang="en">
<a name="gdk-image-unref"></a><h3>gdk_image_unref ()</h3>
<pre class="programlisting">void                gdk_image_unref                     (<a class="link" href="gdk-Images.html#GdkImage" title="GdkImage">GdkImage</a> *image);</pre>
<div class="warning" style="margin-left: 0.5in; margin-right: 0.5in;">
<h3 class="title">Warning</h3>
<p><code class="literal">gdk_image_unref</code> is deprecated and should not be used in newly-written code.</p>
</div>
<p>
Deprecated function; use <a
href="/usr/share/gtk-doc/html/gobject/gobject-The-Base-Object-Type.html#g-object-unref"
><code class="function">g_object_unref()</code></a> instead.</p>
<p>
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody><tr>
<td><p><span class="term"><em class="parameter"><code>image</code></em> :</span></p></td>
<td> a <a class="link" href="gdk-Images.html#GdkImage" title="GdkImage"><span class="type">GdkImage</span></a>
</td>
</tr></tbody>
</table></div>
</div>
<hr>
<div class="refsect2" lang="en">
<a name="gdk-image-destroy"></a><h3>gdk_image_destroy</h3>
<pre class="programlisting">#define gdk_image_destroy              gdk_image_unref
</pre>
<div class="warning" style="margin-left: 0.5in; margin-right: 0.5in;">
<h3 class="title">Warning</h3>
<p><code class="literal">gdk_image_destroy</code> is deprecated and should not be used in newly-written code.</p>
</div>
<p>
Destroys a <a class="link" href="gdk-Images.html#GdkImage" title="GdkImage"><span class="type">GdkImage</span></a>, freeing any resources allocated for it.
</p>
</div>
<hr>
<div class="refsect2" lang="en">
<a name="gdk-image-get-colormap"></a><h3>gdk_image_get_colormap ()</h3>
<pre class="programlisting"><a class="link" href="gdk-Colormaps-and-Colors.html#GdkColormap" title="GdkColormap">GdkColormap</a>*        gdk_image_get_colormap              (<a class="link" href="gdk-Images.html#GdkImage" title="GdkImage">GdkImage</a> *image);</pre>
<p>
Retrieves the colormap for a given image, if it exists.  An image
will have a colormap if the drawable from which it was created has
a colormap, or if a colormap was set explicitely with
<a class="link" href="gdk-Images.html#gdk-image-set-colormap" title="gdk_image_set_colormap ()"><code class="function">gdk_image_set_colormap()</code></a>.</p>
<p>
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td><p><span class="term"><em class="parameter"><code>image</code></em> :</span></p></td>
<td> a <a class="link" href="gdk-Images.html#GdkImage" title="GdkImage"><span class="type">GdkImage</span></a>
</td>
</tr>
<tr>
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
<td> colormap for the image
</td>
</tr>
</tbody>
</table></div>
</div>
<hr>
<div class="refsect2" lang="en">
<a name="gdk-image-set-colormap"></a><h3>gdk_image_set_colormap ()</h3>
<pre class="programlisting">void                gdk_image_set_colormap              (<a class="link" href="gdk-Images.html#GdkImage" title="GdkImage">GdkImage</a> *image,
                                                         <a class="link" href="gdk-Colormaps-and-Colors.html#GdkColormap" title="GdkColormap">GdkColormap</a> *colormap);</pre>
<p>
Sets the colormap for the image to the given colormap.  Normally
there's no need to use this function, images are created with the
correct colormap if you get the image from a drawable. If you
create the image from scratch, use the colormap of the drawable you
intend to render the image to.</p>
<p>
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td><p><span class="term"><em class="parameter"><code>image</code></em> :</span></p></td>
<td> a <a class="link" href="gdk-Images.html#GdkImage" title="GdkImage"><span class="type">GdkImage</span></a>
</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>colormap</code></em> :</span></p></td>
<td> a <a class="link" href="gdk-Colormaps-and-Colors.html#GdkColormap" title="GdkColormap"><span class="type">GdkColormap</span></a>
</td>
</tr>
</tbody>
</table></div>
</div>
<hr>
<div class="refsect2" lang="en">
<a name="gdk-image-put-pixel"></a><h3>gdk_image_put_pixel ()</h3>
<pre class="programlisting">void                gdk_image_put_pixel                 (<a class="link" href="gdk-Images.html#GdkImage" title="GdkImage">GdkImage</a> *image,
                                                         <a
href="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#gint"
>gint</a> x,
                                                         <a
href="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#gint"
>gint</a> y,
                                                         <a
href="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#guint32"
>guint32</a> pixel);</pre>
<p>
Sets a pixel in a <a class="link" href="gdk-Images.html#GdkImage" title="GdkImage"><span class="type">GdkImage</span></a> to a given pixel value.
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td><p><span class="term"><em class="parameter"><code>image</code></em> :</span></p></td>
<td>a <a class="link" href="gdk-Images.html#GdkImage" title="GdkImage"><span class="type">GdkImage</span></a>.
</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>x</code></em> :</span></p></td>
<td>the x coordinate of the pixel to set.
</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>y</code></em> :</span></p></td>
<td>the y coordinate of the pixel to set.
</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>pixel</code></em> :</span></p></td>
<td>the pixel value to set.
</td>
</tr>
</tbody>
</table></div>
</div>
<hr>
<div class="refsect2" lang="en">
<a name="gdk-image-get-pixel"></a><h3>gdk_image_get_pixel ()</h3>
<pre class="programlisting"><a
href="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#guint32"
>guint32</a>             gdk_image_get_pixel                 (<a class="link" href="gdk-Images.html#GdkImage" title="GdkImage">GdkImage</a> *image,
                                                         <a
href="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#gint"
>gint</a> x,
                                                         <a
href="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#gint"
>gint</a> y);</pre>
<p>
Gets a pixel value at a specified position in a <a class="link" href="gdk-Images.html#GdkImage" title="GdkImage"><span class="type">GdkImage</span></a>.
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td><p><span class="term"><em class="parameter"><code>image</code></em> :</span></p></td>
<td>a <a class="link" href="gdk-Images.html#GdkImage" title="GdkImage"><span class="type">GdkImage</span></a>.
</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>x</code></em> :</span></p></td>
<td>the x coordinate of the pixel to get.
</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>y</code></em> :</span></p></td>
<td>the y coordinate of the pixel to get.
</td>
</tr>
<tr>
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
<td>the pixel value at the given position.
</td>
</tr>
</tbody>
</table></div>
</div>
</div>
<div class="refsect1" lang="en">
<a name="gdk-Images.see-also"></a><h2>See Also</h2>
<p>
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td><p><span class="term"><a class="link" href="gdk-Bitmaps-and-Pixmaps.html" title="Bitmaps and Pixmaps">Bitmaps and Pixmaps</a></span></p></td>
<td><p>
Graphics which are stored on the X Windows server.
Since these are stored on the server they can be drawn very quickly, and all
of the <a class="link" href="gdk-Drawing-Primitives.html" title="Drawing Primitives">Drawing Primitives</a> can be
used to draw on them. Their main disadvantage is that manipulating individual
pixels can be very slow.
</p></td>
</tr>
<tr>
<td><p><span class="term"><a class="link" href="gdk-GdkRGB.html" title="GdkRGB">GdkRGB</a></span></p></td>
<td><p>
Built on top of <a class="link" href="gdk-Images.html#GdkImage" title="GdkImage"><span class="type">GdkImage</span></a>, this provides much more functionality,
including the dithering of colors to produce better output on low-color
displays.
</p></td>
</tr>
</tbody>
</table></div>
<p>
</p>
</div>
</div>
<div class="footer">
<hr>
          Generated by GTK-Doc V1.11</div>
</body>
</html>
